﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DataInfo;
using KenLib.BusinessManager;

public partial class APP_frmA_OtherOrgTraineeList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "実習実施機関";
        ((APP_MasterPage_appCom)this.Master).changeTitle("他監理団体所属実習生一覧");
        ((APP_MasterPage_appCom)this.Master).HideLiArea("frmA_OtherOrgTraineeList");
        ShowGrid();
    }


    public void ShowGrid()
    {
        DataTable dt = new DataTable();
        int 企業ID = Int32.Parse(Session["企業コード_2"].ToString()); // Session khi dang nhap vao
        他団体実習生情報Manager frm_他団体実習生情報 = new 他団体実習生情報Manager();
        dt = frm_他団体実習生情報.get他団体実習生情報(企業ID);
        if (dt.Rows.Count > 0)
        {
            grv.Visible = true;
            grv1.Visible = false;
            grv.DataSource = dt;
            grv.DataBind();
        }
        else
        {
            grv.Visible = false;
            grv1.Visible = true;
            AppCode_Common.ShowEmtyGrid<本社履歴>(grv1, 3, "データがありません。", "");
        }
       
    }

    public string ConvertString(string str)// convert chuoi.
    {
        if (str.Equals("True"))
            return "女";
        else return "男";
    }

    public string ConvertDate(string str)// convert ngay thang nam.
    {
        string date = str;
        DateTime d1 = DateTime.Parse(date);
        return date = d1.ToString("yyyy年MM月dd日");
    }


    protected void grv_PageIndexChanging(object sender, GridViewPageEventArgs e)// phan trang
    {
        grv.PageIndex = e.NewPageIndex;
        this.ShowGrid();

    }
    public string ShowTextLength1(string temp)
    {
        //tieng viet
        if (temp.Length > 20)
            temp = temp.Substring(0, 20) + "...";
        if (temp.Length == 0)
        {
            temp = "";
        }
        return temp;

    }
}
